/* dto 是接收参数的，vo 是封装返回的数据的，entity 是和数据库表对应的 */
import { ApiProperty } from "@nestjs/swagger";

// 由于要是有装饰器，所以原理的interface要改成class类型，否则用不了
class UserInfo {
    @ApiProperty()
    id: number;

    @ApiProperty({example: "zhangsan"})
    username: string;

    @ApiProperty({example: "张三"})
    nickName: string;

    @ApiProperty({example: "xxx@xx.com"})
    email: string;

    @ApiProperty({example: "xxx.png"})
    headPic: string;

    @ApiProperty({example: "34124312"})
    phoneNumber: string;

    @ApiProperty()
    isFrozen: boolean;

    @ApiProperty()
    isAdmin: boolean;

    @ApiProperty()
    createTime: Date;

    @ApiProperty({example: ['管理员']})
    roles: string[];

    @ApiProperty({example: ['query_aa']})
    permissions: string[];
}

export class LoginUserVo {
    @ApiProperty()
    userInfo: UserInfo;

    @ApiProperty()
    accessToken: string;

    @ApiProperty()
    refreshToken: string;
}